// 函数组合 调试
//NEVER AY DIE --> nver-ay-die
const _ = require('lodash')

const split = _.curry((sep, array)=> _.split(array, sep))
// toLower
const join = _.curry((sep, array)=> _.join(array,sep))

const log = _.curry((type, v) => {
    console.log(type, v)
    return v
})
// const log = ( v) => {
//     console.log(v)
//     return v
// }
const map = _.curry((fn, array)=> _.map(array, fn))

// const f = _.flowRight(join('-'), log, _.toLower, log, split(' '))

const f = _.flowRight(join('-'), log('map之后'), map(_.toLower), log('split之后'), split(' '))

console.log(f('NEVER AY DIE'))

